<?php
/**
 * this is phpunit suite sample file
 *
 * @usage
 *  run suite:
 *      phpunit samplesuite.php
        
 *
 *
 */
require_once 'index.php';
require_once 'Framework/TestSuite.php';
class SampleSuite extends PHPUnit_Framework_TestSuite
{
    public function __construct()
    {
        //add test file
        $files = $this->getAllTestFile();

        foreach ($files as $v)
        {
            $this->addTestFile($v);
        }
    }

    private function getAllTestFile()
    {
        $dirname = dirname(__FILE__);
        $files   = Util::getDirFiles($dirname);
        $test_files = array();

        foreach ($files as $v)
        {
            $filename = basename($v);
            if (false !== strpos($filename, "test"))
            {
                $test_files[] = $v;
            }
        }

        return $test_files;
    }

    public static function suite()
    {
        //must return
        return new self();
    }

    /**
     * execute before suite
     *
     */
    public function setUp()
    {

    }

    /**
     * execute after suite
     *
     */
    public function tearDown()
    {

    }

}//end class

